import request from '@/utils/request'

//充值
export function apiCreateOrder(data: any) {
    return request.post({url: '/order/create', data}, {isAuth: true})
}

export function apiUpdateOrder(data: any) {
    return request.post({url: '/order/update', data}, {isAuth: true})
}

export function apiCancelOrder(data: any) {
    return request.post({url: '/order/update', data}, {isAuth: true})
}

export function apiDeleteOrder(data: { id: number }) {
    return request.post({url: '/order/delete', data}, {isAuth: true})
}


//充值记录
export function apiListsOrder(data: any) {
    return request.get({url: '/order/lists', data}, {isAuth: true})
}

export function apiDetail(data: { id: number }) {
    return request.get({url: '/order/detail', data}, {isAuth: true})
}

export function apiListsOtherOrder(data: any) {
    return request.get({url: '/order/otherOrderList', data}, {isAuth: true})
}
export function apiAcceptOrder(data: { id: number,master_phone:number }) {
    return request.post({url: '/order/accept', data}, {isAuth: true})
}

// 获取师傅已接单列表
export function apiMasterAcceptedOrders(data: any) {
    return request.post({url: '/order/masterAcceptedOrders', data}, {isAuth: true})
}

export function apiCompleteOrder(data: any) {
    return request.get({url: '/order/completeOrder', data}, {isAuth: true})
}
